import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login')
  },
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/views/Layout'),
    children: [
      {
        path: '',
        name: 'Home',
        component: () => import('@/views/Home')
      },
      {
        path: '/content',
        name: 'Content',
        component: () => import('@/views/Content')
      },
      {
        path: '/images',
        name: 'Images',
        component: () => import('@/views/Images')
      },
      {
        path: '/comment',
        name: 'Comment',
        component: () => import('@/views/Comment')
      },
      {
        path: 'publish',
        name: 'Publish',
        component: () => import('@/views/Publish')
      },
      {
        path: 'setting',
        name: 'Setting',
        component: () => import('@/views/Setting')
      },
      {
        path: '/fans',
        name: 'Fans',
        component: () => import('@/views/Fans')
      }
    ]
  },
  {
    path: '/:catchAll(.*)',
    name: 'NotFound',
    redirect: '/'
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
